<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html;charset=utf-8"%>

<head>

	<title><fmt:message key="authoriyProfile.title" />
	</title>
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/index/index.js'/>">
</script>
	<script type="text/javascript">
function getListByProperties(strvalue) {
	return strvalue.split(',');
}
jQuery(document).ready(
		function() {
			var authoriyvalue = "<fmt:message key='authoriy.type'/>";
			var authoriylist = getListByProperties(authoriyvalue);
			for ( var i = 0; i < authoriylist.length; i++) {
				jQuery('#authoriytypeid').append(
						"<option value='" + (i + 1) + "'>" + authoriylist[i]
								+ "</option>");
			}
		});

function checkattachmentinfo() {

	var finameerror = "<fmt:message key='authoriy.filename.null' />";
	var fileerror = "<fmt:message key='authoriy.file.null' />";
	var filename = document.getElementById("filenameid");
	var finameerrordiv = document.getElementById("finameerror");
	var fileinfo = document.getElementById("fileid");
	var fileiderror = document.getElementById("fileiderror");
	if (filename.value == null || filename.value == "") {
		finameerrordiv.innerHTML = finameerror;
		filename.focus();
		return false;
	} else {
		finameerrordiv.innerHTML = "*";
	}

	if (fileinfo.value == null || fileinfo.value == "") {
		fileiderror.innerHTML = fileerror;
		fileinfo.focus();
		return false;
	} else {
		fileiderror.innerHTML = "*";
	}
	return true;
}
</script>
</head>

<div class="box_big">
	<form:form method="post" action="${ctx}/file/upload.do" id="searchForm"
		enctype="multipart/form-data">
		<div class="bj_biao">
			<h4>
				<fmt:message key="authoriy.upload" />
			</h4>
		</div>
		<div class="box5" id="selectcondiv" align="center">
			<table border="0" cellspacing="0" cellpadding="0" class="table_bj">
				<tr>
					<th>
						<fmt:message key="authoriy.name" />
						:
					</th>
					<td>
						<div style="float: left">
							<input id="filenameid" type="text" name="filename" class="text4" />
						</div>
						<div id="finameerror" style="color: red;">
							*
						</div>
					</td>
					<th>
						<fmt:message key="authoriy.path" />
						:
					</th>
					<td>
						<div style="float: left;">
							<input id="fileid" type="file" name="file1" class="text4" />
						</div>
						<div id="fileiderror" style="color: red;">
							*
						</div>
					</td>
				</tr>
				<tr>
					<th>
						<fmt:message key="authoriy.type" />
						:
					</th>
					<td>
						<select id="authoriytypeid" name="filetype" class="text4"></select>
					</td>
					<th>
						<fmt:message key="authoriy.isrelease" />
						:
					</th>
					<td>
						<fmt:message key="authoriy.isrelease.yes" />
						<input type="radio" name="isrelease" value="1" checked="checked" />
						<fmt:message key="authoriy.isrelease.no" />
						<input type="radio" name="isrelease" value="0" />
					</td>
				</tr>
				<tr>
					<th>
						<fmt:message key="authoriy.description" />
						:
					</th>
					<td>
						<div style="float: left;">
							<textarea rows="10" cols="50" name="note"></textarea>
						</div>
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr height="50" valign="top">
					<td align="center">
						<input type="submit" onclick="return checkattachmentinfo();"
							value="<fmt:message key="authoriy.up"/>" class="btn_blue2" />
						<input type="button" onclick="javascript:history.go(-1);"
							value="<fmt:message key="content.add.back"/>" class="btn_blue2" />
					</td>
				</tr>
			</table>
		</div>
	</form:form>
</div>